package com.itheima.d1_exception;

/**
 * 认识异常
 */
public class ExceptionDemo1 {
    public static void main(String[] args) throws  Exception{
//    show();
    show2();
    }
    //抛出异常 throws
    public static void show() throws Exception{
        int[] arr = {10,20,30};
        System.out.println(arr[3]);
    }


    public static void show2() {
        try{
            int[] arr2 = {10,20,30};
            System.out.println(arr2[3]);
        }catch(Exception e){
            System.out.println("程序出现异常了");
        }

    }
}
